package com.itcast.cn.myhashset;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @PackageName: com.itcast.cn.myhashset
 * @ClassName: Map02
 * @Author: wusong
 * @Date: 2020/7/7 0007 9:47
 * @Description:
 */
public class Map02 {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("1号丈夫", "1号妻子");
        map.put("2号丈夫", "2号妻子");
        map.put("3号丈夫", "3号妻子");
        map.put("4号丈夫", "4号妻子");
        map.put("5号丈夫", "5号妻子");
        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            final String key = entry.getKey();
            final String value = entry.getValue();
            System.out.println(key + "---" + value);
        }
    }
}

